package day02.work04;

public class Circle {
    private double radius;

    //构造器
    public Circle(){}
    public Circle(double radius){this.radius=radius;}

    //get、set
    public double getRadius() {
        return radius;
    }
    public void setRadius(double radius) {
        this.radius = radius;
    }

    //成员方法
    //计算表面积
    public double surfaceArea(){
        double area=0;
        area=3.1415926*radius*radius;
    return area;
    }
    //计算周长
    public double periMater(){
        double mater=0;
        mater=3.1415926*2*radius;
        return mater;
    }
    //重写toString方法
    @Override
    public String toString() {
        return "Circle [radius=" + radius + ", surfaceArea()=" + surfaceArea() + ", periMater()=" + periMater() + "]";
    }
    
}
